package com.dsc.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author: Du Shun Chang
 * @title: Register
 * @date: 2022/2/7 0:42
 * @description: TODO
 * @version：1.0
 */
public class Register extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setCharacterEncoding("utf-8");
        req.setCharacterEncoding("utf-8");
        String username = req.getParameter("username");
        String password = req.getParameter("password");
        String[] games = req.getParameterValues("games");
        System.out.println(username+password);
        System.out.println(Arrays.toString(games));
        req.getRequestDispatcher("success.jsp").forward(req, resp);
    }
}
